{% block header %}
{% endblock %}

{% if request.cookies.get('Scr1wCTFdLanguage') == 'en' %}
{% set en = true %}
{% else %}
{% set en = false %}
{% endif %}

<form method="POST" action="{{ script_root }}/admin/challenges/new" enctype="multipart/form-data">
    {% block name %}
    {% if en %}
    <div class="form-group">
        <label>
            Name:<br>
            <small class="form-text text-muted">
                The name of your challenge
            </small>
        </label>
        <input type="text" class="form-control" name="name" placeholder="Enter challenge name">
    </div>
    {% else %}
    <div class="form-group">
        <label>
            名称:<br>
            <small class="form-text text-muted">
                题目名称
            </small>
        </label>
        <input type="text" class="form-control" name="name" placeholder="输入题目名称">
    </div>
    {% endif %}
    {% endblock %}

    {% block category %}
    {% if en %}
    <div class="form-group">
        <label>
            Category:<br>
            <small class="form-text text-muted">
                The category of your challenge
            </small>
        </label>
        <input type="text" class="form-control" name="category" placeholder="Enter challenge category">
    </div>
    {% else %}
    <div class="form-group">
        <label>
            类别:<br>
            <small class="form-text text-muted">
                题目的类别
            </small>
        </label>
        <input type="text" class="form-control" name="category" placeholder="输入题目类别">
    </div>
    {% endif %}
    {% endblock %}

    {% block subcategory %}
    {% if en %}
    <div class="form-group">
        <label>
            Subcategory:<br>
            <small class="form-text text-muted">
                The subcategory of your challenge
            </small>
        </label>
        <input type="text" class="form-control" name="subcategory" placeholder="Enter challenge subcategory">
    </div>
    {% else %}
    <div class="form-group">
        <label>
            子类别:<br>
            <small class="form-text text-muted">
                题目的子类别
            </small>
        </label>
        <input type="text" class="form-control" name="subcategory" placeholder="输入题目子类别">
    </div>
    {% endif %}
    {% endblock %}

    {% block message %}
    {% if en %}
    <div class="form-group">
        <label>
            Message:<br>
            <small class="form-text text-muted">
                Use this to give a brief introduction to your challenge.
            </small>
        </label>
        <textarea id="new-desc-editor" class="form-control markdown" name="description" rows="10"></textarea>
    </div>
    {% else %}
    <div class="form-group">
        <label>
            题目信息:<br>
            <small class="form-text text-muted">
                用它来简要介绍您的题目。
            </small>
        </label>
        <textarea id="new-desc-editor" class="form-control markdown" name="description" rows="10"></textarea>
    </div>
    {% endif %}
    {% endblock %}

    {% block value %}
    {% if en %}
    <div class="form-group">
        <label>
            Value:<br>
            <small class="form-text text-muted">
                This is how many points are rewarded for solving this challenge.
            </small>
        </label>
        <input type="number" class="form-control" name="value" placeholder="Enter value" required>
    </div>
    {% else %}
    <div class="form-group">
        <label>
            分值:<br>
            <small class="form-text text-muted">
                解决这个题目可以获得多少分
            </small>
        </label>
        <input type="number" class="form-control" name="value" placeholder="输入分值" required>
    </div>
    {% endif %}
    {% endblock %}

    {% block state %}
    <input type="hidden" name="state" value="hidden">
    {% endblock %}

    {% block type %}
    <input type="hidden" name="type" value="standard">
    {% endblock %}

    {% block submit %}
    {% if en %}
    <div class="form-group">
        <button class="btn btn-primary float-right create-challenge-submit" type="submit">Create</button>
    </div>
    {% else %}
    <div class="form-group">
        <button class="btn btn-primary float-right create-challenge-submit" type="submit">创建</button>
    </div>
    {% endif %}
    {% endblock %}
</form>


{% block footer %}
{% endblock %}
